//
//  ViewController.m
//  绘制图片
//
//  Created by 伍银荣 on 2021/7/2.
//  Copyright © 2021 com.example. All rights reserved.
//

#import "ViewController.h"
#import "WYRImageView.h"


@interface ViewController ()
@property (nonatomic, weak) WYRImageView *imageView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //[self createImageView];
}

//创建自定义imageView
- (void)createImageView {
    /**
     imageView的init方法和initWithImage的区别:
     1.使用init方法创建出来的imageView的frame为0,而使用initWithImage方法创建出来的imageView此时已经有默认的frame了,就是image的frame
     */
    
    //    WYRImageView *imageView = [[WYRImageView alloc]init];
    //    imageView.frame = CGRectMake(0, 88, 375, 375);
    //    imageView.image = [UIImage imageNamed:@"霉霉"];
    //    [self.view addSubview:imageView];
    //    self.imageView = imageView;
    
    WYRImageView *imageView = [[WYRImageView alloc]initWithImage:[UIImage imageNamed:@"霉霉"]];
    [self.view addSubview:imageView];
    self.imageView = imageView;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    NSLog(@"touchesBegan");
    //_imageView.frame = CGRectMake(0, 88,  375, 375);
   // _imageView.image = [UIImage imageNamed:@"热巴"];
}


@end
